<template>
  <div v-if="visible" class="content">
    <cross-line :text="$t('lang.operate.approvalHistory')" />
  </div>
</template>

<script lang="ts">
import { ObjectType } from 'typings/interfaces'
import { defineComponent, toRefs, PropType } from 'vue'
import { isEmpty } from 'lodash'
import CrossLine from './CrossLine.vue'

export default defineComponent({
  name: 'ApprovalHistory',
  components: {
    CrossLine,
  },
  props: {
    approvalHistoryRecords: {
      type: Array as PropType<ObjectType>,
      require: true,
    },
    valuePath: {
      type: String,
      default: '',
    },
  },
  setup(props) {
    const { approvalHistoryRecords } = toRefs(props)
    return {
      visible: !isEmpty(approvalHistoryRecords),
      records: approvalHistoryRecords,
    }
  },
})
</script>

<style lang="scss" scoped>
.content {
  .title {
    width: 100%;
    display: flex;
    align-items: center;
    span {
      width: 60px;
    }
    hr {
      width: 100%;
      border: 1px solid #5bb0ff;
    }
  }
}
</style>
